class A
{
    public:
        void fun() {}
};

class B
{
    public:
        friend void A::fun() {}
};